Scanning on FreeBSD
I have two scanners, an Epson Perfection V330 Photo which I use for photo/negative scanning (plus the occasional single page document) and a Fujitsu ScanSnap S500 for document scanning (as it has a duplex auto-feeder, so I can put a stack of papers in it and it will scan both sides of everything). I use the Fujitsu primarily for archiving and OCR-ing documents into multi-page PDFs in order to keep the amount of physical papers in my life low, and to that end I wrote the SDAT software to handle this automatically for me while I was on Linux.
Now that I have switched to FreeBSD as my desktop OS, I decided to write this page to document the situation with my two scanners and how compatible they are with FreeBSD. The short answer is that the Fujitsu works perfectly, and the Epson not at all (as it turns out it relies on a binary blob that is only compiled for Linux, see below for details).
Setting up a Fujitsu Scansnap on FreeBSD
In my case the Fujitsu did not work out of the box ("scanimage -L" did not find it, but "sane-find-scanner" did). In order go get the Fujitsu to work I had to edit the "/usr/local/etc/sane.d/dll.conf" to uncomment the "fujitsu" driver, after which is worked as expected:
device 'fujitsu:ScanSnap S500:14658' is a FUJITSU ScanSnap S500 scanner
A helpful link for me was This Ubuntu page. Just remember that FreeBSD has a different path ("/usr/local").
Setting up the Epson Perfection V330
The Epson requires the "epkowa" proprietary driver which is not included by default in the sane installation. Originally there were no drivers available but I've noticed that since FreeBSD 13 they provide both source (via ports) and binary (via pkg) installation methods. I installed the binary package using "pkg", which also modified our dll.conf to load the driver automatically for us.However despite this, "scanimage -L" still did not show the scanner. Running in debug mode shows the driver being loaded but no devices being found:
#~$ SANE_DEBUG_DLL=5 scanimage -L [13:56:15.628817] [sanei_debug] Setting debug level of dll to 5. [13:56:15.628921] [dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.3.1 [13:56:15.628936] [dll] sane_init/read_dlld: attempting to open directory './dll.d' [13:56:15.628943] [dll] sane_init/read_dlld: attempting to open directory '/usr/local/etc/sane.d/dll.d' [13:56:15.628960] [dll] sane_init/read_dlld: using config directory '/usr/local/etc/sane.d/dll.d' [13:56:15.628991] [dll] sane_init/read_dlld: done. [13:56:15.629002] [dll] sane_init/read_config: reading dll.conf [13:56:15.629036] [dll] add_backend: adding backend 'epkowa' [13:56:15.629056] [dll] sane_get_devices [13:56:15.629063] [dll] load: searching backend 'epkowa' in '/usr/local/lib/sane' [13:56:15.629067] [dll] load: trying to load '/usr/local/lib/sane/libsane-epkowa.so.1' [13:56:15.629074] [dll] load: dlopen()ing '/usr/local/lib/sane/libsane-epkowa.so.1' [13:56:15.629196] [dll] init: initializing backend 'epkowa' [13:56:15.629538] [dll] init: backend 'epkowa' is version 1.0.209 [13:56:15.629547] [dll] sane_get_devices: found 0 devices
However sane-find-scanner did find it and listed it correctly as an Epson, showing that its not a permissions/usb issue:
found possible USB scanner (vendor=0x04b8 [EPSON], product=0x0142 [EPSON Perfection V33/V330]) at libusb:000:009
After researching online the hint to what was missing could be found in the SANE supported manufacturers webpage. Specifically for the V330 it says: "supported by the epkowa backend plus non-free interpreter". We have installed the epkowa driver, but not the interpreter.
Turns out that Epson do provide us with the source code on their Linux driver web page, we want the option to download the "the source file", and they helpfully give us instructions on how to build it here.
Unfortunately that is (a) for Linux and (b) for the entire suite, when all we actually need is the interpreter. So I decided to see if I can build it for FreeBSD. After spending some time on this, the short answer is "No". The problem is that the "source" package actually contains a single binary, which I suspect is the actual proprietary interpreter, listed below:
./src/ScanSDK/Src/SDK/epsonscansdk: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=713e5f33bfac8abf3cb5ff8c2a096623951a3b79, not stripped
As its a binary rather than source code I can't try to modify or build it on FreeBSD. It might be possible to get it to run on the FreeBSD Linux compatibility Layer but it seems like a lot of work to set up just for a single scanner driver. As such I am just going to abandon this attempt and just use the Epson via a Virtual Machine when needed. I would like to say that perhaps in future the situation will improve but I doubt it simply because the V330 was released in 2010, 15 years ago now, so I doubt any active development or improvements can be expected to occur. If however you are aware of any development that would help get it to work feel free to get in touch and let me know, so I can update this page :-)